﻿using System;
using System.Collections.Generic;
using System.Windows.Forms;

namespace RegExpRegExpGenerator
{
    public partial class ExpressionMatchesForm : Form
    {
        public ExpressionMatchesForm()
        {
            InitializeComponent();
        }

        public void updateList(List<string> ex)
        {
            expressionsList.Items.Clear();
            expressionsList.Items.AddRange(ex.ToArray());
        }

        private void removeExpressionBtn_Click(object sender, EventArgs e)
        {

            if (expressionsList.SelectedIndex != -1)
           {
          //      // remove selection in original list
          //      parent.expressions.RemoveAt(expressionsList.SelectedIndex);
          //      updateList(parent.expressions);
           }
        }


        private void loadExpressionBtn_Click(object sender, EventArgs e)
        {

            if (expressionsList.SelectedIndex != -1)
            {
      //      // remove selection in original list
      //      parent.regexBox.Text = expressionsList.SelectedItem.ToString();
            }
        }


        private void clearListBtn_Click(object sender, EventArgs e)
        {
            // clear listbox
            expressionsList.Items.Clear();

            //parent.expressions.Clear();
        }


        private void ExpressionMatchesForm_FormClosing(object sender, FormClosingEventArgs e)
        {
            e.Cancel = true;
            Hide();
        }
    }
}